# MainMenu.gd
extends Control

@onready var start_button: Button = $MarginContainer/VBoxContainer/StartButton
@onready var upgrades_button: Button = $MarginContainer/VBoxContainer/UpgradesButton # For permanent upgrades
@onready var quit_button: Button = $MarginContainer/VBoxContainer/QuitButton

func _ready():
	start_button.pressed.connect(_on_start_button_pressed)
	upgrades_button.pressed.connect(_on_upgrades_button_pressed) # Connect if you add this screen
	quit_button.pressed.connect(_on_quit_button_pressed)
	print("MainMenu Ready")


func _on_start_button_pressed():
	# Transition to the main game scene
	var error = get_tree().change_scene_to_file("res://scenes/main/MainGame.tscn")
	if error != OK:
		printerr("Failed to change scene to MainGame:", error)


func _on_upgrades_button_pressed():
	# Transition to the permanent upgrade screen (create this scene first)
	# get_tree().change_scene_to_file("res://scenes/ui/MetaUpgradeScreen.tscn")
	print("Permanent Upgrades Screen - Not Implemented Yet")


func _on_quit_button_pressed():
	get_tree().quit()
